package org.jash.shop2202

import kotlinx.coroutines.runBlocking
import org.jash.shop2202.net.ApiService
import org.jash.shop2202.utils.getService
import org.jash.shop2202.utils.retrofit
import org.junit.Test

import org.junit.Assert.*

/**
 * Example local unit test, which will execute on the development machine (host).
 *
 * See [testing documentation](http://d.android.com/tools/testing).
 */
class ExampleUnitTest {
    @Test
    fun addition_isCorrect() {
        assertEquals(4, 2 + 2)
    }
    @Test
    fun testNet() = runBlocking {
//        val service:ApiService = retrofit.create(ApiService::class.java)
        val service:ApiService = getService()
        val res = service.getCategory()
        res.data.forEach(::println)
    }
}